{extend name='public/layout' /}
{block name='content'}
<div class="main">
    <div class="position"><p><span>更新时间：{:date("Y年m月d日")}</span>您当前的位置：{$site.title} > <a href="{:url('Loupan/index')}">新房</a> </p></div>
    <div class="screen">
        <div class="tab03 overflow_h">
            <ul class="idTabs">
                <li><a href="{:url('Loupan/index')}">按楼盘筛选</a></li>
                <li><a href="{:url('Loupan/huxing')}" class="selected">按户型筛选</a></li>
            </ul>
        </div>
        <div class="screen_box" id="h_tab01">
            <div class="screen_box01 overflow_h">
                <span>区域：</span>
                <ul>
                    <li><a href="{:getUrl('Loupan/huxing','area',$param,0)}" {empty name='search.area'}class="on"{/empty}>不限</a></li>
                    {volist name='area' id='vo'}
                    <li><a title="{$vo.name}" {if condition='$vo.id eq $search.area'}class="on"{/if} href="{:getUrl('Loupan/huxing','area',$param,$vo['id'])}">{$vo.name}</a></li>
                    {/volist}
                </ul>
            </div>

            <div class="screen_box01 overflow_h">
                <span>户型：</span>
                <ul>
                    <li><a href="{:getUrl('Loupan/huxing','room',$param,0)}" {empty name='search.room'}class="on"{/empty}>不限</a></li>
                    {volist name='roomType' id='vo'}
                    <li><a href="{:getUrl('Loupan/huxing','room',$param,$key)}" {if condition='$key eq $search.room'}class="on" {/if}>{$vo}</a></li>
                    {/volist}
                </ul>
            </div>

            <div class="screen_box01 overflow_h">
                <span>总价：</span>
                <ul>
                    <li><a href="{:getUrl('Loupan/huxing','price',$param,0)}" {empty name='search.price'}class="on"{/empty}>不限</a></li>
                    {volist name='price' id='vo'}
                    <li><a href="{:getUrl('Loupan/huxing','price',$param,$key)}" {if condition='$key eq $search.price'}class="on"{/if}>{$vo.name}</a></li>
                    {/volist}
                </ul>
            </div>

            <div class="screen_box01 overflow_h">
                <span>装修：</span>
                <ul>
                    <li><a {empty name="search.renovation"} class="on"{/empty} href="{:getUrl('Loupan/huxing','renovation',$param,0)}">不限</a></li>
                    {volist name='renovation' id='vo'}
                    <li><a {if condition="$vo.id eq $search.renovation"} class="on" {/if} href="{:getUrl('Loupan/huxing','renovation',$param,$vo['id'])}">{$vo.name}</a></li>
                    {/volist}
                </ul>
            </div>

        </div>
    </div>

    <div class="overflow_h">
        <div class="house_l">
            <div class="house_l_t">
                <div class="h_l_t_n1">
                    <div class="tab03 overflow_h">
                        <ul class="idTabs">
                            <li><a href="{:url('Loupan/huxing')}">全部户型({$lists->total()})</a></li>
                        </ul>
                    </div>
                </div>
                <div class="h_l_t_n2">
                    <span class="moren"><a href="{:getUrl('Loupan/huxing','sort',$param,0)}" {empty name="search.sort"}class="selected"{/empty}>默认排序</a></span>
<span>
    <select class="h_select" name="mianji" id="mianji-order">
        <option value="0">按面积排序</option>
        <option value="{:getUrl('Loupan/huxing','sort',$param,3)}" {if condition="$sort eq 3"}selected{/if}>面积由低到高</option>
        <option value="{:getUrl('Loupan/huxing','sort',$param,4)}" {if condition="$sort eq 4"}selected{/if}>面积由高到低</option>
    </select>
<select class="h_select" name="price" id="price-order">
    <option value="0">按价格排序</option>
    <option value="{:getUrl('Loupan/huxing','sort',$param,1)}" {if condition="$sort eq 1"}selected{/if}>价格由低到高</option>
    <option value="{:getUrl('Loupan/huxing','sort',$param,2)}" {if condition="$sort eq 2"}selected{/if}>价格由高到低</option>
</select>
</span>
                </div>
            </div>

            <div class="house_box ">
                <ul>
                    {volist name='lists' id='vo' empty='<li>暂无数据</li>'}
                    <li class="overflow_h">
                        <div class="h_box01">
                            <a href="{:url('Loupan/typeShow',['house_id'=>$vo['house_id'],'id'=>$vo['id']])}" title="{$vo.house_name}"><img src="__IMG__/loading.gif" alt="{$vo.house_name}" class="lazy" data-original="{$vo.img}" width="217" height="165"></a>
                        </div>
                        <div class="h_box02_1"><b><span><a href="{:url('Loupan/typeShow',['house_id'=>$vo['house_id'],'id'=>$vo['id']])}" title="{$vo.title}">{$vo.title}</a></span></b></div>
                        <div class="h_box02">
                            <p>所属楼盘：
                                {$vo.house_name}
                            </p>
                            <p>楼盘地址：{$vo.address}</p>
                            {notempty name='vo.special'}
                            <p class="org">
                                户型特色：
                                {$vo.special}
                            </p>
                            {/notempty}
                            <div class="h_ts">{php}$tags_name=unserialize($vo['tags_name']);{/php}
                                {volist name='tags_name' id='val'}
                                <i class="h_ts0{$i}">{$val}</i>
                                {/volist}
                            </div>
                        </div>
                        <div class="h_box03">
                            <b>{$vo.price}<i>万</i></b>
                            <div style="text-align:center;">{$vo.jianzhu_area}m<sup>2</sup></div>
                        </div>
                    </li>
                    {/volist}

                </ul>

                <div class="plastic_bottom_pages">{$pages}</div>
            </div>

        </div>
        <div class="house_r">
            <div>
                <div class="title01">找房神探</div>
                <div class="find_house overflow_h">
                    <div class="f_t"><span>填写需求</span><i></i><span>神探找房</span><i></i><span>推荐房源</span></div>
                    <div class="f_from">
                        <form action="{:url('Ajax/demand')}" method="post" id="info_form">
                            <div class="f_from_b">
                                <p>您的首付金额<i class="org">*</i></p>
                                <p><input class="f_input01" type="text" name="shoufu" id="shoufu"></p>
                            </div>

                            <div class="f_from_b overflow_h">
                                <p>意向户型<i class="org">*</i></p>
                                <p>
                                    <input class="f_input01" type="text" name="huxing" id="huxing">
                                </p>
                            </div>

                            <div class="f_from_b">
                                <p>其他意向</p>
                                <p>
                                    <textarea class="f_input02" name="content" id="textarea2" placeholder="如：意向区域范围、意向楼盘、是否要求地铁沿线，重点学位等。" cols="45" rows="5"></textarea>
                                </p>
                            </div>

                            <div class="f_from_c">
                                <p>为了更好地为您服务，请留下联系方式</p>
                                <p><input type="text" name="mobile" class="f_input03" id="mobile" placeholder="请输入手机号码"></p>
                                <p class="overflow_h">
                                    <input name="code" type="text" class="f_input04" id="code" placeholder="请输入校验码">
                                    <span class="f_yzm"><img src="{:captcha_src()}" id="verfiy" width="98" height="38"></span>
                                </p>
                                <input type="hidden" name="area" value="{$cityInfo.name}">
                                <p><a href="javascript:;" class="but06" id="demand-btn">帮我找房</a></p>
                            </div>

                        </form>
                    </div>
                </div>
            </div>

            <div class="m_t_15">
                <div class="title01"><span class="more"><a href="{:url('Loupan/index')}">更多 ></a></span>热门楼盘</div>
                <div class="hot_h">{php}$cityId = $cityInfo['id'];{/php}
                    {fang:lists table='house' where='status=1 and city=$cityId' field='id,title,img,average_price,city_name,area_name,open_time' order='hits desc,id desc' limit='5' id='vo'}
                    <dl class="overflow_h">
                        <dt><a href="{:url('Loupan/detail',['id'=>$vo['id']])}" title="{$vo.title}"><img src="__IMG__/loading.gif" class="lazy" data-original="{$vo.img}" alt="{$vo.title}" width="120" height="90"></a></dt>
                        <dd class="hot_h_t1"><a href="{:url('Loupan/detail',['id'=>$vo['id']])}" title="{$vo.title}">{$vo.title}</a></dd>
                        <dd class="hot_h_t2">{$vo.average_price}元/平米</dd>
                        <dd class="hot_h_t3">{$vo.city_name}{$vo.area_name}</dd>
                        <dd class="hot_h_t3 nowarp" title="{$vo.open_time}">开盘时间：{$vo.open_time}</dd>
                    </dl>
                    {/fang:lists}
                </div>
                {volist name='ads' id='vo'}
                <div class="h_img">{$vo}</div>
                {/volist}
            </div>

        </div>




    </div>

</div>

<script src="__PUBLIC__/js/plugins/jquery.ajax.form.js"></script>
<script>
    $(function(){

        $('#price-order,#mianji-order').bind('change',function(){
           var url = $(this).val();
            if(url!=0){
                window.location.href = url;
            }

        });
        $('#verfiy').bind('click',function(){
            $(this).attr("src","{:captcha_src()}?t="+Math.random());
        });
        $('#demand-btn').bind('click',function(){
            var shoufu = $('#shoufu').val(),huxing = $('#huxing').val(),mobile = $('#mobile').val(),reg = /^1[34578][0-9]{9}$/;
            if(shoufu.length == 0){
                layer.msg('请填写首付金额',{icon:2});
                return false;
            }
            if(huxing.length == 0){
                layer.msg('请填写意向户型',{icon:2});
                return false;
            }
            if(!reg.test(mobile)){
                layer.msg('请填写正确的手机号码',{icon:2});
                return false;
            }
            $('#info_form').submit();
        });
        $('#info_form').ajaxForm({success:complate,dataType:'json'});
        function complate(result){
            if(result.status == 1){
                layer.msg(result.msg,{icon:1});
                setTimeout(function(){
                    window.location.href = location.href + '?t='+Math.random();
                },3000);
            } else {
                layer.msg(result.msg,{icon:2});
            }
        }
    });
</script>
{/block}